import { createBrowserRouter } from "react-router-dom";
import { MainLayout } from "../layouts/index";
import Home from "../views/home/home";
import About from "../views/about/about";
import Setting from "../views/user/setting/setting";
import Login from "../views/user/login/login";

export const router = createBrowserRouter(
  [
    {
      path: "/",
      element: <MainLayout />,
      children: [
        {
          path: "main",
          element: <Home />,
        },
        {
          path: "about",
          element: <About />,
        },
        {
          path: "user",
          children: [{ path: "setting", element: <Setting /> }],
        },
      ],
    },
    {
      path: "/login",
      element: <Login />,
    },
  ],
  { basename: window.__POWERED_BY_QIANKUN__ ? "/react-app" : "/" }
);
